import com.golden.gamedev.object.*;
import com.golden.gamedev.object.collision.*;


public class BounceCollisions extends CollisionGroup{
	public BounceCollisions(){
		this.pixelPerfectCollision = true;
	}
	@Override
	public void collided(Sprite item, Sprite wall) {
		int side = getCollisionSide();
		this.printCollisionSide();
		if(side == TOP_BOTTOM_COLLISION || side == BOTTOM_TOP_COLLISION){
			double initSpeedY = item.getVerticalSpeed();
			item.setVerticalSpeed(-(initSpeedY));
		}
		else {
			double initSpeedX = item.getHorizontalSpeed();
			item.setHorizontalSpeed(-(initSpeedX));
		}
	}
}
